package com.netease.a.b;

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import org.apache.http.util.EncodingUtils;

public abstract class a
{
  protected static final String a = "----------------314159265358979323846";
  protected static final byte[] b = EncodingUtils.getAsciiBytes("----------------314159265358979323846");
  protected static final String c = "\r\n";
  protected static final byte[] d;
  protected static final String e = "\"";
  protected static final byte[] f;
  protected static final String g = "--";
  protected static final byte[] h;
  protected static final String i = "Content-Disposition: form-data; name=";
  protected static final byte[] j;
  protected static final String k = "Content-Type: ";
  protected static final byte[] l;
  protected static final String m = "; charset=";
  protected static final byte[] n;
  protected static final String o = "Content-Transfer-Encoding: ";
  protected static final byte[] p;
  private static final byte[] q = b;
  private byte[] r;

  static
  {
    d = EncodingUtils.getAsciiBytes("\r\n");
    f = EncodingUtils.getAsciiBytes("\"");
    h = EncodingUtils.getAsciiBytes("--");
    j = EncodingUtils.getAsciiBytes("Content-Disposition: form-data; name=");
    l = EncodingUtils.getAsciiBytes("Content-Type: ");
    n = EncodingUtils.getAsciiBytes("; charset=");
    p = EncodingUtils.getAsciiBytes("Content-Transfer-Encoding: ");
  }

  public static long a(a[] paramArrayOfa)
  {
    return a(paramArrayOfa, q);
  }

  public static long a(a[] paramArrayOfa, byte[] paramArrayOfByte)
  {
    if (paramArrayOfa == null)
      throw new IllegalArgumentException("Parts may not be null");
    int i1 = 0;
    long l1 = 0L;
    long l3;
    long l2;
    if (i1 < paramArrayOfa.length)
    {
      paramArrayOfa[i1].a(paramArrayOfByte);
      l3 = paramArrayOfa[i1].i();
      if (l3 < 0L)
        l2 = -1L;
    }
    while (true)
    {
      return l2;
      l1 += l3;
      i1++;
      break;
      l2 = l1 + h.length + paramArrayOfByte.length + h.length + d.length;
    }
  }

  public static String a()
  {
    return "----------------314159265358979323846";
  }

  public static void a(OutputStream paramOutputStream, a[] paramArrayOfa)
  {
    a(paramOutputStream, paramArrayOfa, q);
  }

  public static void a(OutputStream paramOutputStream, a[] paramArrayOfa, byte[] paramArrayOfByte)
  {
    if (paramArrayOfa == null)
      throw new IllegalArgumentException("Parts may not be null");
    if ((paramArrayOfByte == null) || (paramArrayOfByte.length == 0))
      throw new IllegalArgumentException("partBoundary may not be empty");
    for (int i1 = 0; i1 < paramArrayOfa.length; i1++)
    {
      paramArrayOfa[i1].a(paramArrayOfByte);
      paramArrayOfa[i1].h(paramOutputStream);
    }
    paramOutputStream.write(h);
    paramOutputStream.write(paramArrayOfByte);
    paramOutputStream.write(h);
    paramOutputStream.write(d);
  }

  protected void a(OutputStream paramOutputStream)
  {
    paramOutputStream.write(h);
    paramOutputStream.write(f());
    paramOutputStream.write(d);
  }

  void a(byte[] paramArrayOfByte)
  {
    this.r = paramArrayOfByte;
  }

  public abstract String b();

  protected void b(OutputStream paramOutputStream)
  {
    paramOutputStream.write(j);
    paramOutputStream.write(f);
    paramOutputStream.write(EncodingUtils.getAsciiBytes(b()));
    paramOutputStream.write(f);
  }

  public abstract String c();

  protected void c(OutputStream paramOutputStream)
  {
    String str1 = c();
    if (str1 != null)
    {
      paramOutputStream.write(d);
      paramOutputStream.write(l);
      paramOutputStream.write(EncodingUtils.getAsciiBytes(str1));
      String str2 = d();
      if (str2 != null)
      {
        paramOutputStream.write(n);
        paramOutputStream.write(EncodingUtils.getAsciiBytes(str2));
      }
    }
  }

  public abstract String d();

  protected void d(OutputStream paramOutputStream)
  {
    String str = e();
    if (str != null)
    {
      paramOutputStream.write(d);
      paramOutputStream.write(p);
      paramOutputStream.write(EncodingUtils.getAsciiBytes(str));
    }
  }

  public abstract String e();

  protected void e(OutputStream paramOutputStream)
  {
    paramOutputStream.write(d);
    paramOutputStream.write(d);
  }

  protected abstract void f(OutputStream paramOutputStream);

  protected byte[] f()
  {
    if (this.r == null);
    for (byte[] arrayOfByte = q; ; arrayOfByte = this.r)
      return arrayOfByte;
  }

  protected void g(OutputStream paramOutputStream)
  {
    paramOutputStream.write(d);
  }

  public boolean g()
  {
    return true;
  }

  protected abstract long h();

  public void h(OutputStream paramOutputStream)
  {
    a(paramOutputStream);
    b(paramOutputStream);
    c(paramOutputStream);
    d(paramOutputStream);
    e(paramOutputStream);
    f(paramOutputStream);
    g(paramOutputStream);
  }

  public long i()
  {
    long l1;
    if (h() < 0L)
      l1 = -1L;
    while (true)
    {
      return l1;
      ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
      a(localByteArrayOutputStream);
      b(localByteArrayOutputStream);
      c(localByteArrayOutputStream);
      d(localByteArrayOutputStream);
      e(localByteArrayOutputStream);
      g(localByteArrayOutputStream);
      l1 = localByteArrayOutputStream.size() + h();
    }
  }

  public String toString()
  {
    return b();
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.a.b.a
 * JD-Core Version:    0.6.0
 */